<?php
/**
 * Smarty plugin
 * -------------------------------------------------------------
 * File:     insert.module_cssjs.php
 * Type:     time
 * Name:     time
 * Author:   王超, <wisoch@hotmail.com>
 * Purpose:  输出页面头css js
 * -------------------------------------------------------------
 */

function smarty_insert_module_cssjs($params, $smarty) {
	$js = $css = array();
	if($params['js']) $js = explode(';', trim($params['js'], ';'));
	if($params['css']) $css = explode(';', trim($params['css'], ';'));
	
	$js = array_map('trim', $js);
	$css = array_map('trim', $css);
	
	if($js) $smarty->assign('js', $js);
	if($css) $smarty->assign('css', $css);
	
	$html = $smarty->fetch('module/module_cssjs.html');
	return $html;
}
?>